﻿<?xml version="1.0" encoding="utf-8" ?>
<log4net debug="false">
  <appender name="RollingLogFileAppenderDebug" type="log4net.Appender.RollingFileAppender">
    <file value="./ConsoleService.log" />
    <appendToFile value="true" />
    <rollingStyle value="Size" />
    <maxSizeRollBackups value="10" />
    <maximumFileSize value="5MB" />
    <staticLogFileName value="true" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date %-5level %logger %F(%L) %m%n" />
    </layout>
  </appender>
  <appender name="RollingLogFileAppenderInfo" type="log4net.Appender.RollingFileAppender">
    <file value="./main.log" />
    <appendToFile value="true" />
    <rollingStyle value="Size" />
    <maxSizeRollBackups value="20" />
    <maximumFileSize value="5MB" />
    <staticLogFileName value="true" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="[%date %-5level %logger] %m%n" />
    </layout>
  </appender>
	<logger name="Main">
    <level value="ALL" />
    <appender-ref ref="RollingLogFileAppenderInfo" />
	</logger>
  <appender name="RollingLogFileAppenderProcess" type="log4net.Appender.RollingFileAppender">
    <file value="./ConsoleService-Process.log" />
    <appendToFile value="true" />
    <rollingStyle value="Size" />
    <maxSizeRollBackups value="20" />
    <maximumFileSize value="5MB" />
    <staticLogFileName value="true" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="[%date %-5level %logger] %m%n" />
    </layout>
  </appender>
  <logger name="Process">
    <level value="ALL" />
    <appender-ref ref="RollingLogFileAppenderProcess" />
  </logger>
</log4net>
<!-- 日志输出格式化：
%m(message):输出的日志消息，如IWFLog.Write(…)输出的一条消息
%n(new line):换行
%d(datetime):输出当前语句运行的时刻
%r(run time):输出程序从运行到执行到当前语句时消耗的毫秒数
%t(thread id):当前语句所在的线程ID
%p(priority): 日志的当前优先级别，即DEBUG、INFO、WARN…等
%c(class):当前日志对象的名称，例如：
       模式字符串为：%-10c -%m%n
       代码为：
ILog log=LogManager.GetLogger(“Exam.Log”);
WFLog.Write(“Hello”);
    则输出为下面的形式：
Exam.Log       - Hello
%L：输出语句所在的行号
%F：输出语句所在的文件名
%-数字：表示该项的最小长度，如果不够，则用空格填充
    	<conversionPattern value="发生时间：%date%n事件级别：%-5level%n事件来源：%logger%n日志内容：%m%n" />
      <conversionPattern value="%date %-5level %logger %F:(%L) %c %p %t %m%n" />
      <conversionPattern value="%date %-5level %logger  %m%n" />
  <root>
    <level value="ALL" />
    <appender-ref ref="RollingLogFileAppender" />
  </root>
 -->